
function deepCopy (o, ...src) {
  for (let item of src) {
    for (let i in item) {
      if (item.hasOwnProperty(i)) {
        if (item[i].constructor === Object && typeof o[i] !== 'undefined') {
          o[i] = deepCopy(o[i], item[i]);
        } else {
          o[i] = item[i];
        }
      }
    }
  }
  return o;
}

module.exports = deepCopy;